/******************************************************************************
 * * setting_tone.h - data structure for setting tone sub-module
 *
 * *(C) Copyright 2019 Asr International Ltd.
 * * All Rights Reserved
 * ******************************************************************************/
#ifndef SETTING_TONE_H
#define SETTING_TONE_H

#ifdef __cplusplus
extern "C" {
#endif

#define SETTING_WARNING_TONE_VOLUME    HAL_AUDIO_SPK_9dB

typedef enum
{
    SETTING_VIBRATING_OFF = 0,
    SETTING_VIBRATING_ON,
    SETTING_VIBRATING_RING_THEN
} SETTING_VIBRATING_STAT;

typedef enum
{
    SETTING_MSG_ALERT_OFF = 0,
    SETTING_MSG_ALERT_STANDARD,                                                 // Beep and vibrating twice
    SETTING_MSG_ALERT_RING                                                      // use Ring Tone for message alert
} SETTING_MSG_ALERT_STAT;

typedef enum
{
    SETTING_WARNING_TONE_OFF = 0,
    SETTING_WARNING_TONE_ON                                                     // play Beep tone and vibrating twice
} SETTING_WARNING_TONE_STAT;

typedef enum
{
    SETTING_TONE_PRIO_NULL = 0,
    SETTING_TONE_PRIO_KEYPAD ,
    SETTING_TONE_PRIO_SETTING,                                                  // for setting tone
    SETTING_TONE_PRIO_CONTACTS,
    SETTING_TONE_PRIO_AUDIO_PLAYER,
    SETTING_TONE_PRIO_ALARM,
    SETTING_TONE_PRIO_CALENDAR,
    SETTING_TONE_PRIO_WARNING,
    SETTING_TONE_PRIO_SMS,
    SETTING_TONE_PRIO_CALL,
    SETTING_TONE_PRIO_SYSTEM                                                    // for power on/off
} SETTING_TONE_PRIO;

typedef struct
{
    UINT8                     CurrentRingToneIndex[2];                          // current ring index in g_RingToneList for two SIM
#define SETTING_MAX_VOLUME_LEVEL    10                                          // 0-10 0:mute
    UINT8                     RingVolume;                                       // refer to Hal interface
    UINT8                     KeypadToneVolume;                                 // refer to Hal interface
    SETTING_VIBRATING_STAT    VibratingStat;                                    // Vibrating status
    SETTING_MSG_ALERT_STAT    MsgAlertStat[2];                                  // message alert status for two SIM
    UINT8                     CurrentMsgToneIndex[2];                           // for two SIM, Valid when MsgAlertStat is SETTING_MSG_ALERT_RING
    SETTING_WARNING_TONE_STAT WarningToneStat;                                  // warning tone status
} Setting_Tone_Setting_Mng_t;

typedef struct
{
    BOOL                      RingPlaying;                                      // true means play ring tone.
    SETTING_TONE_PRIO         TonePrio;                                         // priority of playing tone
    UINT8                     ProfileEditingIdx;                                // current editing profile index in setting_profile
    UINT8                     ProfileActivateIdx;                               // current activate profile index in setting_profile
    BOOL                      ProfileOperatingIdx;                              // current profile operating index in setting_profile
    BOOL                      ProfileTimingSta;                                 // current profile timing status in setting_profile
} Setting_Tone_Function_Mng_t;

extern Setting_Tone_Setting_Mng_t g_SettingToneSettingMng;                      // manage entity for tone settings
extern Setting_Tone_Function_Mng_t g_SettingToneFunctionMng;                    // manage entity for other function using in tone settings
extern Setting_Tone_Setting_Mng_t *g_OperatingTone;                             // pointer of operating tone strcture for tone of profile
extern VOID Display_Setting_Tone_Settings(VOID);
extern VOID Setting_Set_Operating_Tone(Setting_Tone_Setting_Mng_t *OperatingTone);
extern VOID Setting_Update_Profile_Para(UINT8 ChgFlg, UINT8 ChgPara);

#ifdef __cplusplus
} /* extern "C" */
#endif

#endif /*SETTING_TONE_H*/
